//
//  UILabel+Extension.swift
//  WeiBo
//
//  Created by AaronWei on 2017/6/5.
//  Copyright © 2017年 AaronWei. All rights reserved.
//

import UIKit

extension UILabel {
    
    convenience init(title: String, fontSize: CGFloat, textColor: UIColor, maxWidth: CGFloat?) {
        
        self.init()
        
        font = UIFont.systemFont(ofSize: fontSize)
        
        self.textColor = textColor
        
        text = title
        
        textAlignment = .center
        
        numberOfLines = 0
        
        if let width = maxWidth {
            
            preferredMaxLayoutWidth = width
            
        }
        
    }
    
}
